package com.yandex.yandexfotki.activities;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

import com.yandex.yandexfotki.R;

public class SplashActivity extends Activity{
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);
		Message msg = new Message();
	    msg.what = STOPSPLASH;
	    splashHandler.sendMessageDelayed(msg, SPLASHTIME);
	}

	private Handler splashHandler = new Handler() { 
		 
	   @Override
	   public void handleMessage(Message msg) {
	       switch (msg.what) {
	       case STOPSPLASH:
	           goToApplication();
	           break;
	       }
	       super.handleMessage(msg);
	   }
	};
	
	private void goToApplication(){
		Intent intent = new Intent(this,StartActivity.class);
		startActivity(intent);
		finish();
	}
	
	private static final int STOPSPLASH = 0;
	private static final long SPLASHTIME = 1800;
	
}
